package com.example.demo.conteroll;

import com.example.demo.model.User;
import com.example.demo.service.Materialservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by DELL on 2018/12/27.
 */

@RestController
public class Conterill {
    @Autowired
private Materialservice materialservice;

    @PostMapping("/queryall")
        public List<User> getuser(){
            return materialservice.queryall();
        }


    @GetMapping("querybyid")
        public User queryUser(@RequestParam("id")Integer id){
        return materialservice.queryUser(id);

    }

    @GetMapping("/update")
        public int updateUser(@RequestBody User user){

        return  materialservice.update(user);
    }
}
